home *** CD-ROM | disk | FTP | other *** search
- set u .5
- set min 0
- set max 1
- set width 1
- set height .25
- set fontName Helvetica
- set fontSize 20
- set sliderColor {1.0 0.0 0.0}
-
- defineClass: slider {current min max width height fontName fontSize sliderColor} {
-
- AttributeBegin
- Attribute identifier name sliderAtValue${current}
- Sides 2
- AttributeBegin
- Attribute identifier name min
- # need to go up and and in
- Patch bilinear P "0 0 [expr {-.75 * $height}] 0 [expr {-1 * $height}] [expr {-.75 * $height}] \
- 0 0 [expr {.75 * $height}] 0 [expr {-1 * $height}] [expr {.75 * $height}]"
- Translate 0 [expr {.5 * $height}] 0
- WW3DText $fontName $fontSize [format %g $min] center
- AttributeEnd
-
- AttributeBegin
- Attribute identifier name max
- Translate $width 0 0
- Patch bilinear P "0 0 [expr {-.75 * $height}] 0 [expr {-1 * $height}] [expr {-.75 * $height}] \
- 0 0 [expr {.75 * $height}] 0 [expr {-1 * $height}] [expr {.75 * $height}]"
- Translate 0 [expr {.5 * $height}] 0
- WW3DText $fontName $fontSize [format %g $max] center
- AttributeEnd
-
- AttributeBegin
- Attribute identifier name slider
- Color $sliderColor
- Patch bilinear P "0 0 0 0 [expr {-1 * $height}] 0 \
- [expr {($current/($max-$min)) * $width}] 0 0 [expr {($current/($max-$min)) * $width}] [expr {-1 * $height}] 0"
- AttributeEnd
- AttributeEnd
- }
-
- loadControlPanel controls.nib
-
- startShape aSlider
- animatable: {slider [expr {$u * ($max - $min)}] $min $max $width $height $fontName $fontSize $sliderColor}
- endShape
-